﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sahit.iSoilHotel.Application.Seedwork;
using Sahit.iSoilHotel.Application.MainBoundedContext.Tavern.Interfaces;
using Sahit.iSoilHotel.Domain.MainBoundedContext.Tavern.Aggregates.PriceAgg;
using Sahit.iSoilHotel.Application.MainBoundedContext.DTO.PriceAgg;

namespace Sahit.iSoilHotel.Application.MainBoundedContext.Tavern.Services
{
    public class PriceCodeService:IPriceCodeService
    {
          #region Members

        private readonly IPriceCodeRepository priceCodeRepository;
        #endregion

        #region Constructor

        public PriceCodeService(
            IPriceCodeRepository priceCodeRepository)
        {
            if (priceCodeRepository == null)
                throw new ArgumentNullException("PriceCodeRepository", "PriceCodeRepository is null!");

            this.priceCodeRepository = priceCodeRepository;
        }
        #endregion

        public PriceCode GetPriceCode(Guid priceCodeID)
        {
            return priceCodeRepository.Get(priceCodeID);
        }


        public List<PriceCodeDTO> GetAllPriceCodes()
        {
            return priceCodeRepository.GetAll().ProjectedAsCollection<PriceCodeDTO>();
        }
    }
}
